//
// Created by wze-zero on 2024/10/18.
//
#include <iostream>

using namespace std;

int main() {
    string s;
    getline(cin, s);
    int num1 = 0, num2 = 0;
    for (int i = 0; i < s.size(); ++i) {
        if (s.at(i) == 'A') {
            num1++;
        } else if (s.at(i) == 'B') {
            num2++;
        }
    }
    if (num1 > num2) {
        cout << 'A' << endl;
    } else if (num1 < num2) {
        cout << 'B' << endl;
    } else {
        cout << 'E' << endl;
    }
    return 0;
}